import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Scanner;


public class Layout {
	
	public  void showFriend(ResultSet rs){
		try {
			if(rs!=null){
				System.out.printf("%-10s%-30s%-10s%-50s\n","ID","Name","Gender","Address");
			}
			while(rs.next()){
				System.out.printf("%-10s%-30s%-10s%-50s\n",rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4));
			}
		} catch (SQLException ex) {
			System.out.println(ex.getMessage());
		}finally{
			if(rs!=null){
				try {
					rs.close();
				} catch (SQLException e) {
					System.err.println(e);
				}
			}
		}
	}
	
	public void showCommand(){
		System.out.println();
		System.out.println("1.Add Friend  2.Delete Friend  3.Update Friend  4.Search Friend  5.Display All Friend  6.Exit");
	}
}
